/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tsystems.school.server;

/**
 *
 * @author 123
 */
import com.google.gson.*;
import com.tsystems.school.utils.Message;
import com.tsystems.school.utils.MessageType;

public class Main {

    public static final int PORT_WORK = 8080;
    public static final int PORT_STOP = 9001;

    public static void main(String[] args) {
        JServer server = new JServer(PORT_WORK);
        new Thread(server).start();
        try {
            Thread monitor = new StopMonitor(PORT_STOP);
            monitor.start();
            monitor.join();
            System.out.println("Right after join.....");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("Stopping Server");
        server.stop();
//Class c = Message.class;
//
//        Gson gs = new Gson();
//        String str = gs.toJson(new int[] {1,2,3});
//       // A a = gs.fromJson(str, A.class);
//        System.out.println(str);
        
    }
}

class A {
    private String name = "A";
    private int age = 12;
    
    public A(){}
    public A(String name, int age) {
        this.name = name;
        this.age = age;
    }
    
    @Override
    public String toString() {
        return name + " " + age;
    }
}

